﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CuaHangMayTinh.PresentationLayer.Splash
{
    public partial class Splash1 : Form
    {
        public string Text { get; set; }

        public Splash1()
        {
            InitializeComponent();
            timer1.Start();
        }

        public Splash1(string text) : this()
        {
            Text = text;
            SwitchString(text);
        }

        public Splash1(int inc)
            : this()
        {
            this.inc = inc;
        }

        private void SwitchString(string txt)
        {
            if(txt=="")
                txt = "Chờ tí nhé !";
            labelX_text.Text = txt;
        }


        private void Splash1_Load(object sender, EventArgs e)
        {
        }

        int inc=100;
        int per = 0;
        private void timer1_Tick(object sender, EventArgs e)
        {
            circularProgress2.Value += per;
            per += inc;
        }

        private void circularProgress2_ValueChanged(object sender, EventArgs e)
        {
            circularProgress2.IsRunning = !circularProgress2.IsRunning;
        }
    }
}
